# Device Note - DRV8833 Motor Driver Module

## What It Is
The DRV8833 module is a dual H-bridge motor driver. It lets a low-power controller send logic commands to drive higher-current DC motors.

## Why It Is Used
Microcontroller pins are for control signals, not motor power. DRV8833 handles motor current using an external supply while still accepting logic-level control inputs.

## Pin Overview
Module labels used in this course:
- Top row: `IN4`, `IN3`, `GND`, `VCC`, `IN2`, `IN1`
- Bottom row: `EEP`, `OUT1`, `OUT2`, `OUT3`, `OUT4`, `ULT`

Functional mapping for this board:
- `IN1` + `IN2` -> drive `OUT1`/`OUT2` (Motor A)
- `IN3` + `IN4` -> drive `OUT3`/`OUT4` (Motor B)
- `GND` -> shared ground with controller
- `VCC` -> motor supply input on this module variant
- `EEP` -> enable/sleep-style control line (must be enabled for normal operation)
- `ULT` -> status/fault-style output on this module variant (optional for basic lessons)

## Control Behavior
Per channel logic:
- `INx1=1`, `INx2=0` -> forward
- `INx1=0`, `INx2=1` -> reverse
- `INx1=0`, `INx2=0` -> coast
- `INx1=1`, `INx2=1` -> brake

Speed control:
- PWM on active `IN` drive control sets average motor voltage/current.
- Higher duty cycle usually means higher speed under same load.

## Wiring Rules
- Always share ground between controller and motor driver.
- Use external motor supply suitable for the motor.
- Keep motor power path separate from fragile signal wiring where practical.

## Common Failure Modes
- No shared ground -> random/non-responsive control.
- Enable pin fixed low -> no motion.
- Direction pins swapped -> opposite behavior.
- Undersized supply -> weak/jerky motion.

## Classroom Notes
- Start with one channel first (`IN1 IN2` + `OUT1 OUT2`).
- Begin at low PWM to reduce inrush and surprises.
- Teach coast vs brake as different electrical states, not just "stop".

## Integration With This Course
Recommended command concepts:
- direction set (forward/reverse)
- speed set (PWM value/range)
- stop modes (coast/brake/stop)

This matches model-driven control panels and automation actions where command names and parameter ranges are defined in the course model.
